package willand.com.cloud.clickhouse.clickhousejdbc.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class ClickhouseCommandRunner implements CommandLineRunner {

    @Autowired
    private ClickhouseService clickhouseService;

    @Override
    public void run(String... args) throws Exception {
        while (true) {
            try {
//                clickhouseService.insert(null);
                clickhouseService.getOrders(1000);
            }catch (Exception e){
                e.printStackTrace();
            }

        }
    }
}
